//////////////////////////////////////////////////////////////////////////////////
//
//	DoD TK No Death
//		- Version 1.0
//		- 04.15.2007
//		- diamond-optic
//
//////////////////////////////////////////////////////////////////////////////////
//
// Information:
//
// 	- When someone gets TK'd, they will not
//	  get a death added to their score...
//
// CVARS: 
//
//	  dod_tk_nodeath "1"	//Turn ON(1)/OFF(0)
//
// Extra:
//
//	- Just a very simple plugin made for a request
//
// Changelog:
//
//	 - 04.15.2007 Version 1.0
//		Initial Release
//
//////////////////////////////////////////////////////////////////////////////////

#include <amxmodx>
#include <dodfun>

new p_on

public plugin_init()
{
	register_plugin("DoD TK No Death","1.0","AMXX DoD Team")
	
	register_cvar("dod_tk_nodeath_stats", "1.0", FCVAR_SERVER|FCVAR_SPONLY)
	
	register_event("DeathMsg","funcDeath","a")
	
	p_on = register_cvar("dod_tk_nodeath", "1")
}

public funcDeath()
{
	new killer = read_data(1)
	new victim = read_data(2)
	
	if(get_pcvar_num(p_on) && is_user_connected(victim) && is_user_connected(killer))
		if(killer != victim && get_user_team(killer) == get_user_team(victim))
			dod_set_pl_deaths(victim,dod_get_pl_deaths(victim) - 1,1)
}
